<?php
// 网页开发服务配置 - 优化版
$configKey = isset($configKey) ? $configKey : 'web-development';
$defaultConfig = [
    'section_id' => 'web-development',
    'section_pretitle' => '网页技术',
    'section_title' => '专业网页开发服务',
    'section_subtitle' => '打造响应式、高性能的网站与web应用，提升品牌形象与用户体验',
    'bg_color' => 'gray-50',
    'card_style' => 'modern', // modern, classic, minimal
    
    // 文本配置
    'texts' => [
        'tech_stacks_title' => '我们的技术栈',
        'tech_stacks_subtitle' => '采用前沿技术与最佳实践，确保网站性能卓越、安全可靠且易于扩展',
        'process_title' => '我们的开发流程',
        'process_subtitle' => '系统化的开发方法确保项目按时交付、质量可靠且符合业务需求',
        'case_studies_title' => '网页开发成功案例',
        'case_studies_subtitle' => '我们开发的网站与web应用帮助各行业客户实现业务目标与数字化转型',
        'pricing_title' => '网页开发服务定价',
        'pricing_subtitle' => '灵活的开发方案满足不同规模项目需求，确保高质量交付',
        'view_more_cases' => '浏览更多案例',
        'custom_solution_text' => '需要定制化开发服务？',
        'contact_us_text' => '联系我们',
        'get_custom_quote' => '获取专属方案',
        'required_mark' => '*',
        'form_success_message' => '您的咨询已提交成功！我们的网页开发专家将在24小时内与您联系。',
        'form_submitting_text' => '提交中...',
        'case_challenge' => '挑战',
        'case_solution' => '解决方案',
        'case_results' => '成果',
        'view_full_case' => '查看完整案例',
        'typical_results' => '典型成果'
    ],
    
    // 样式配置
    'classes' => [
        'section' => 'py-16',
        'container' => 'mx-auto px-4 sm:px-6 lg:px-8',
        'section_title_wrapper' => 'text-center max-w-3xl mx-auto mb-16',
        'section_pretitle' => 'inline-block text-sm font-semibold text-blue-600 uppercase tracking-wider mb-2',
        'section_title' => 'text-3xl md:text-4xl font-bold text-gray-900 mb-4',
        'section_subtitle' => 'text-lg text-gray-600',
        'card_base' => 'p-8 rounded-xl transition-all duration-300 h-full',
        'card_hover_effect' => 'hover:shadow-lg transition-all duration-300',
        'feature_list_item' => 'flex items-center text-sm text-gray-700',
        'feature_icon' => 'fa fa-check mr-2',
        'button_primary' => 'inline-flex items-center px-6 py-3 border border-transparent text-base font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 transition-colors duration-300',
        'button_primary_icon' => 'fa fa-chevron-right ml-2',
        'button_secondary' => 'block w-full py-3 px-4 text-white font-medium rounded-lg transition-all duration-300 text-center',
        'form_field' => 'w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-300',
        'form_label' => 'block text-gray-700 font-medium mb-2',
        'required_indicator' => 'text-red-500',
        'process_step_wrapper' => 'flex flex-col items-center text-center',
        'process_step_number' => 'w-16 h-16 rounded-full text-blue-600 flex items-center justify-center text-2xl font-bold mb-4 border-2 border-blue-100 shadow-sm',
        'process_step_title' => 'text-xl font-semibold mb-2 text-gray-900',
        'process_step_desc' => 'text-gray-600 text-sm',
        'success_icon' => 'fa fa-arrow-up text-green-500 mr-2',
        'tech_icon_wrapper' => 'w-14 h-14 text-blue-600 rounded-lg flex items-center justify-center mb-6 text-2xl border-2 border-blue-100',
        'tech_list_item' => 'flex items-center text-gray-700',
        'tech_bullet' => 'fa fa-circle text-xs text-blue-500 mr-2'
    ],
    
    'services' => [
        [
            'id' => 'corporate-websites',
            'title' => '企业官网建设',
            'description' => '定制符合品牌形象的企业官网，展示企业实力与服务，提升品牌影响力',
            'icon' => 'fa-building',
            'accent_color' => 'blue-600',
            'features' => [
                '品牌形象设计',
                '响应式布局',
                '产品展示系统',
                '新闻资讯模块',
                'SEO优化'
            ],
            'results' => [
                '访问量增长' => '+120%',
                '停留时间' => '+65%',
                '转化率' => '+38%'
            ],
            'case_study' => '为制造业企业重构官网，3个月内询盘量提升85%，品牌搜索量增长150%'
        ],
        [
            'id' => 'ecommerce-solutions',
            'title' => '电商网站开发',
            'description' => '构建功能完善的在线商城系统，支持多渠道销售与精细化运营管理',
            'icon' => 'fa-shopping-cart',
            'accent_color' => 'green-600',
            'features' => [
                '全功能购物车',
                '多支付网关集成',
                '订单管理系统',
                '会员积分体系',
                '营销活动工具'
            ],
            'results' => [
                '销售额增长' => '+210%',
                '复购率' => '+45%',
                '客单价' => '+32%'
            ],
            'case_study' => '为时尚品牌打造电商平台，上线6个月交易额突破2000万，转化率达4.8%'
        ],
        [
            'id' => 'web-applications',
            'title' => 'Web应用开发',
            'description' => '开发交互式、高性能的web应用，解决业务流程数字化与协同办公需求',
            'icon' => 'fa-cogs',
            'accent_color' => 'purple-600',
            'features' => [
                '定制业务逻辑',
                '实时数据交互',
                '用户权限管理',
                '第三方系统集成',
                '数据分析报表'
            ],
            'results' => [
                '效率提升' => '+180%',
                '错误率降低' => '-75%',
                '运营成本' => '-40%'
            ],
            'case_study' => '为物流企业开发调度管理系统，车辆利用率提升35%，人力成本降低28%'
        ],
        [
            'id' => 'website-optimization',
            'title' => '网站优化升级',
            'description' => '对现有网站进行性能优化、体验升级与安全加固，提升竞争力',
            'icon' => 'fa-rocket',
            'accent_color' => 'orange-500',
            'features' => [
                '加载速度优化',
                'UI/UX升级',
                '安全漏洞修复',
                '移动端适配',
                '搜索引擎优化'
            ],
            'results' => [
                '加载速度' => '-70%',
                '跳出率' => '-45%',
                '安全评分' => '+80%'
            ],
            'case_study' => '为教育机构优化网站，页面加载速度提升75%，报名转化率提高62%'
        ]
    ],
    'tech_stacks' => [
        [
            'title' => '前端技术',
            'technologies' => [
                'HTML5/CSS3',
                'JavaScript (ES6+)',
                'React',
                'Vue.js',
                'Angular',
                'Tailwind CSS',
                'Next.js'
            ],
            'icon' => 'fa-code'
        ],
        [
            'title' => '后端技术',
            'technologies' => [
                'Node.js',
                'PHP',
                'Python',
                'Java',
                'Ruby on Rails',
                'Django',
                'Laravel'
            ],
            'icon' => 'fa-server'
        ],
        [
            'title' => '数据库与存储',
            'technologies' => [
                'MySQL',
                'PostgreSQL',
                'MongoDB',
                'Redis',
                'Firebase',
                'AWS S3',
                'Elasticsearch'
            ],
            'icon' => 'fa-database'
        ],
        [
            'title' => 'DevOps & 云服务',
            'technologies' => [
                'Docker',
                'Kubernetes',
                'AWS',
                'Azure',
                'Google Cloud',
                'CI/CD Pipelines',
                'Monitoring Tools'
            ],
            'icon' => 'fa-cloud'
        ]
    ],
    'process' => [
        [
            'step' => 1,
            'title' => '需求分析',
            'description' => '深入理解业务目标与用户需求，确定功能范围与技术方案'
        ],
        [
            'step' => 2,
            'title' => '原型设计',
            'description' => '创建交互原型与视觉设计，确定用户体验与界面风格'
        ],
        [
            'step' => 3,
            'title' => '开发测试',
            'description' => '模块化开发与持续测试，确保功能完整性与系统稳定性'
        ],
        [
            'step' => 4,
            'title' => '部署上线',
            'description' => '服务器配置、数据迁移与灰度发布，确保平稳上线'
        ],
        [
            'step' => 5,
            'title' => '运维优化',
            'description' => '性能监控、安全维护与持续优化，保障系统长期稳定运行'
        ]
    ],
    'case_studies' => [
        [
            'id' => 'finance-portal',
            'title' => '金融服务门户',
            'platform' => '响应式Web应用',
            'challenge' => '需要构建安全可靠、高性能的金融服务平台，支持复杂数据展示与交易处理',
            'solution' => '采用React+Node.js技术栈，结合微服务架构与高级安全协议，确保系统稳定与数据安全',
            'results' => [
                '用户量' => '50万+',
                '系统可用性' => '99.9%',
                '页面加载' => '0.8秒',
                '安全评分' => 'A+'
            ],
            'image' => 'https://picsum.photos/seed/financeweb/800/500',
            'image_alt' => '金融服务门户网站界面'
        ],
        [
            'id' => 'multivendor-marketplace',
            'title' => '多商户电商平台',
            'platform' => '定制电商系统',
            'challenge' => '需要构建支持数千商家入驻的多商户平台，具备高并发处理能力与复杂订单管理',
            'solution' => '基于微服务架构开发，结合分布式缓存与负载均衡，确保高并发场景下的系统稳定性',
            'results' => [
                '入驻商家' => '3000+',
                '日均订单' => '15000+',
                '系统响应' => '<200ms',
                '转化率' => '5.2%'
            ],
            'image' => 'https://picsum.photos/seed/ecommerce/800/500',
            'image_alt' => '多商户电商平台界面'
        ]
    ],
    'pricing' => [
        [
            'id' => 'basic-website',
            'title' => '基础网站包',
            'subtitle' => '适合展示型中小企业官网',
            'price' => 19800,
            'period' => '项目',
            'features' => [
                '5-8个页面',
                '响应式设计',
                '基础SEO优化',
                '简单表单功能',
                '1年免费维护',
                '域名与主机配置'
            ],
            'recommended' => false
        ],
        [
            'id' => 'business-website',
            'title' => '企业网站包',
            'subtitle' => '适合功能完善的企业网站',
            'price' => 49800,
            'period' => '项目',
            'features' => [
                '无限页面',
                '响应式设计',
                '高级SEO优化',
                '产品展示系统',
                '新闻发布系统',
                '表单与留言系统',
                '2年免费维护',
                '数据分析集成'
            ],
            'recommended' => true
        ],
        [
            'id' => 'web-application',
            'title' => 'Web应用包',
            'subtitle' => '适合定制化业务系统',
            'price' => 98000,
            'period' => '起',
            'features' => [
                '定制功能开发',
                '用户权限管理',
                '数据管理系统',
                '第三方系统集成',
                '高级安全配置',
                '性能优化',
                '3年免费维护',
                '专属技术支持'
            ],
            'recommended' => false
        ]
    ],
    'cta' => [
        'title' => '准备好打造您的网站了吗？',
        'subtitle' => '免费获取网站建设方案与报价，根据您的需求定制最合适的解决方案',
        'button_text' => '获取网站方案',
        'form_action' => '/submit-web.php',
        'features' => [
            [
                'icon' => 'fa-globe',
                'title' => '需求分析',
                'description' => '深入了解您的业务目标，提供量身定制的网站解决方案'
            ],
            [
                'icon' => 'fa-paint-brush',
                'title' => '设计规划',
                'description' => '基于品牌调性与用户体验，规划网站架构与视觉风格'
            ],
            [
                'icon' => 'fa-code',
                'title' => '技术方案',
                'description' => '选择最适合的技术栈，确保网站性能、安全与可扩展性'
            ]
        ]
    ],
    'form' => [
        'id' => 'webForm',
        'fields' => [
            [
                'name' => 'company',
                'type' => 'text',
                'label' => '公司名称',
                'placeholder' => '请输入您的公司名称',
                'required' => true
            ],
            [
                'name' => 'contact_name',
                'type' => 'text',
                'label' => '联系人姓名',
                'placeholder' => '请输入您的姓名',
                'required' => true
            ],
            [
                'name' => 'phone',
                'type' => 'tel',
                'label' => '联系电话',
                'placeholder' => '请输入您的联系电话',
                'required' => true
            ],
            [
                'name' => 'email',
                'type' => 'email',
                'label' => '电子邮箱',
                'placeholder' => '请输入您的电子邮箱',
                'required' => true
            ],
            [
                'name' => 'website_type',
                'type' => 'select',
                'label' => '网站类型',
                'required' => true,
                'options' => [
                    '' => '请选择网站类型',
                    'corporate' => '企业官网',
                    'ecommerce' => '电商网站',
                    'portal' => '行业门户',
                    'application' => 'Web应用',
                    'blog' => '博客/资讯',
                    'other' => '其他类型'
                ]
            ],
            [
                'name' => 'website_features',
                'type' => 'textarea',
                'label' => '功能需求描述',
                'placeholder' => '请简要描述您需要的网站功能、参考案例及期望上线时间...',
                'rows' => 4,
                'required' => false
            ]
        ]
    ]
];
$webConfig = array_merge($defaultConfig, $pageConfig['components'][$configKey] ?? []);
// 移除背景设置

// 处理卡片样式
$cardStyles = [
    'modern' => $webConfig['classes']['card_base'] . " shadow-md hover:shadow-xl hover:-translate-y-1",
    'classic' => $webConfig['classes']['card_base'] . " border border-gray-200 hover:border-primary",
    'minimal' => $webConfig['classes']['card_base']
];
$cardClass = $cardStyles[$webConfig['card_style']] ?? $cardStyles['modern'];
?>

<!-- 网页开发服务页面 -->
<section id="<?php echo htmlspecialchars($webConfig['section_id']); ?>" class="<?php echo $webConfig['classes']['section']; ?>">
    <div class="<?php echo $webConfig['classes']['container']; ?>">
        <!-- 区域标题 -->
        <div class="<?php echo $webConfig['classes']['section_title_wrapper']; ?>">
            <?php if (!empty($webConfig['section_pretitle'])): ?>
                <span class="<?php echo $webConfig['classes']['section_pretitle']; ?>">
                    <?php echo htmlspecialchars($webConfig['section_pretitle']); ?>
                </span>
            <?php endif; ?>
            
            <h2 class="<?php echo $webConfig['classes']['section_title']; ?>">
                <?php echo htmlspecialchars($webConfig['section_title']); ?>
            </h2>
            
            <?php if (!empty($webConfig['section_subtitle'])): ?>
                <p class="<?php echo $webConfig['classes']['section_subtitle']; ?>">
                    <?php echo htmlspecialchars($webConfig['section_subtitle']); ?>
                </p>
            <?php endif; ?>
        </div>

        <!-- 开发服务类型 -->
        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8 mb-20">
            <?php foreach ($webConfig['services'] as $service): ?>
                <div class="<?php echo $cardClass; ?> group" data-service-card>
                    <!-- 图标容器 -->
                    <div class="w-16 h-16 bg-<?php echo $service['accent_color']; ?>/10 text-<?php echo $service['accent_color']; ?> rounded-lg flex items-center justify-center mb-6 text-2xl transition-transform duration-500 group-hover:scale-110">
                        <i class="fa <?php echo htmlspecialchars($service['icon']); ?>"></i>
                    </div>
                    
                    <!-- 服务信息 -->
                    <h3 class="text-xl font-semibold mb-3 text-gray-900 transition-colors duration-300 group-hover:text-<?php echo $service['accent_color']; ?>">
                        <?php echo htmlspecialchars($service['title']); ?>
                    </h3>
                    
                    <p class="text-gray-600 mb-6">
                        <?php echo htmlspecialchars($service['description']); ?>
                    </p>
                    
                    <!-- 服务特点 -->
                    <ul class="space-y-2 mb-6">
                        <?php foreach ($service['features'] as $feature): ?>
                            <li class="<?php echo $webConfig['classes']['feature_list_item']; ?>">
                                <i class="fa <?php echo $webConfig['classes']['feature_icon']; ?> text-<?php echo $service['accent_color']; ?>"></i>
                                <?php echo htmlspecialchars($feature); ?>
                            </li>
                        <?php endforeach; ?>
                    </ul>
                    
                    <!-- 服务成果 -->
                    <div class="bg-gray-50 p-4 rounded-lg border border-gray-100 mb-6">
                        <h4 class="text-sm font-medium text-gray-900 mb-3"><?php echo htmlspecialchars($webConfig['texts']['typical_results']); ?></h4>
                        <div class="grid grid-cols-2 gap-3">
                            <?php foreach ($service['results'] as $metric => $value): ?>
                                <div>
                                    <div class="text-xs text-gray-500"><?php echo htmlspecialchars($metric); ?></div>
                                    <div class="text-lg font-bold text-<?php echo $service['accent_color']; ?>"><?php echo htmlspecialchars($value); ?></div>
                                </div>
                            <?php endforeach; ?>
                        </div>
                    </div>
                    
                    <!-- 案例简述 -->
                    <p class="text-sm text-gray-700 italic">
                        "<?php echo htmlspecialchars($service['case_study']); ?>"
                    </p>
                </div>
            <?php endforeach; ?>
        </div>
        
        <!-- 技术栈展示 -->
        <div class="max-w-5xl mx-auto mb-20">
            <div class="<?php echo $webConfig['classes']['section_title_wrapper']; ?>">
                <h2 class="<?php echo $webConfig['classes']['section_title']; ?>">
                    <?php echo htmlspecialchars($webConfig['texts']['tech_stacks_title']); ?>
                </h2>
                <p class="<?php echo $webConfig['classes']['section_subtitle']; ?> max-w-3xl mx-auto">
                    <?php echo htmlspecialchars($webConfig['texts']['tech_stacks_subtitle']); ?>
                </p>
            </div>
            
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8">
                <?php foreach ($webConfig['tech_stacks'] as $stack): ?>
                    <div class="bg-white p-8 rounded-xl shadow-md <?php echo $webConfig['classes']['card_hover_effect']; ?>">
                        <div class="<?php echo $webConfig['classes']['tech_icon_wrapper']; ?>">
                            <i class="fa <?php echo htmlspecialchars($stack['icon']); ?>"></i>
                        </div>
                        <h3 class="text-xl font-semibold mb-4 text-gray-900"><?php echo htmlspecialchars($stack['title']); ?></h3>
                        <ul class="space-y-2">
                            <?php foreach ($stack['technologies'] as $tech): ?>
                                <li class="<?php echo $webConfig['classes']['tech_list_item']; ?>">
                                    <i class="fa <?php echo $webConfig['classes']['tech_bullet']; ?>"></i>
                                    <?php echo htmlspecialchars($tech); ?>
                                </li>
                            <?php endforeach; ?>
                        </ul>
                    </div>
                <?php endforeach; ?>
            </div>
        </div>
        
        <!-- 开发流程 -->
        <div class="max-w-5xl mx-auto mb-20">
            <div class="<?php echo $webConfig['classes']['section_title_wrapper']; ?>">
                <h2 class="<?php echo $webConfig['classes']['section_title']; ?>">
                    <?php echo htmlspecialchars($webConfig['texts']['process_title']); ?>
                </h2>
                <p class="<?php echo $webConfig['classes']['section_subtitle']; ?> max-w-3xl mx-auto">
                    <?php echo htmlspecialchars($webConfig['texts']['process_subtitle']); ?>
                </p>
            </div>
            
            <div class="relative">
                <!-- 连接线 -->
                <div class="hidden md:block absolute top-1/2 left-0 right-0 h-1 bg-gray-200 -translate-y-1/2 z-0"></div>
                
                <div class="grid grid-cols-1 md:grid-cols-5 gap-4 md:gap-8 relative z-10">
                    <?php foreach ($webConfig['process'] as $step): ?>
                        <div class="<?php echo $webConfig['classes']['process_step_wrapper']; ?>">
                            <div class="<?php echo $webConfig['classes']['process_step_number']; ?>">
                                <?php echo $step['step']; ?>
                            </div>
                            <h3 class="<?php echo $webConfig['classes']['process_step_title']; ?>">
                                <?php echo htmlspecialchars($step['title']); ?>
                            </h3>
                            <p class="<?php echo $webConfig['classes']['process_step_desc']; ?>">
                                <?php echo htmlspecialchars($step['description']); ?>
                            </p>
                        </div>
                    <?php endforeach; ?>
                </div>
            </div>
        </div>
        
        <!-- 成功案例 -->
        <div class="max-w-6xl mx-auto mb-20">
            <div class="<?php echo $webConfig['classes']['section_title_wrapper']; ?>">
                <h2 class="<?php echo $webConfig['classes']['section_title']; ?>">
                    <?php echo htmlspecialchars($webConfig['texts']['case_studies_title']); ?>
                </h2>
                <p class="<?php echo $webConfig['classes']['section_subtitle']; ?> max-w-3xl mx-auto">
                    <?php echo htmlspecialchars($webConfig['texts']['case_studies_subtitle']); ?>
                </p>
            </div>
            
            <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
                <?php foreach ($webConfig['case_studies'] as $case): ?>
                    <div class="bg-white rounded-xl shadow-md overflow-hidden <?php echo $webConfig['classes']['card_hover_effect']; ?>">
                        <div class="lg:flex">
                            <div class="lg:shrink-0 lg:w-1/2">
                                <img 
                                    class="h-48 w-full object-cover lg:h-full lg:w-full" 
                                    src="<?php echo htmlspecialchars($case['image']); ?>" 
                                    alt="<?php echo htmlspecialchars($case['image_alt']); ?>"
                                >
                            </div>
                            <div class="p-8 lg:w-1/2">
                                <div class="text-sm font-semibold text-blue-600 mb-2">
                                    <?php echo htmlspecialchars($case['platform']); ?>
                                </div>
                                <h3 class="text-2xl font-bold text-gray-900 mb-3">
                                    <?php echo htmlspecialchars($case['title']); ?>
                                </h3>
                                
                                <div class="mb-4">
                                    <h4 class="text-sm font-semibold text-gray-900 mb-1"><?php echo htmlspecialchars($webConfig['texts']['case_challenge']); ?></h4>
                                    <p class="text-gray-600 text-sm">
                                        <?php echo htmlspecialchars($case['challenge']); ?>
                                    </p>
                                </div>
                                
                                <div class="mb-4">
                                    <h4 class="text-sm font-semibold text-gray-900 mb-1"><?php echo htmlspecialchars($webConfig['texts']['case_solution']); ?></h4>
                                    <p class="text-gray-600 text-sm">
                                        <?php echo htmlspecialchars($case['solution']); ?>
                                    </p>
                                </div>
                                
                                <div>
                                    <h4 class="text-sm font-semibold text-gray-900 mb-1"><?php echo htmlspecialchars($webConfig['texts']['case_results']); ?></h4>
                                    <ul class="text-sm text-gray-700 space-y-1">
                                        <?php foreach ($case['results'] as $metric => $value): ?>
                                            <li class="flex items-center">
                                                <i class="fa <?php echo $webConfig['classes']['success_icon']; ?>"></i>
                                                <span><?php echo htmlspecialchars($metric . ': ' . $value); ?></span>
                                            </li>
                                        <?php endforeach; ?>
                                    </ul>
                                </div>
                                
                                <div class="mt-6">
                                    <a href="/case-studies/<?php echo htmlspecialchars($case['id']); ?>" class="inline-flex items-center text-blue-600 hover:text-blue-800 font-medium">
                                        <?php echo htmlspecialchars($webConfig['texts']['view_full_case']); ?>
                                        <i class="fa fa-long-arrow-right ml-2"></i>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php endforeach; ?>
            </div>
            
            <div class="text-center mt-10">
                <a href="/case-studies" class="<?php echo $webConfig['classes']['button_primary']; ?>">
                    <?php echo htmlspecialchars($webConfig['texts']['view_more_cases']); ?>
                    <i class="fa <?php echo $webConfig['classes']['button_primary_icon']; ?>"></i>
                </a>
            </div>
        </div>
        
        <!-- 开发服务定价 -->
        <div class="max-w-5xl mx-auto mb-20">
            <div class="<?php echo $webConfig['classes']['section_title_wrapper']; ?>">
                <h2 class="<?php echo $webConfig['classes']['section_title']; ?>">
                    <?php echo htmlspecialchars($webConfig['texts']['pricing_title']); ?>
                </h2>
                <p class="<?php echo $webConfig['classes']['section_subtitle']; ?> max-w-3xl mx-auto">
                    <?php echo htmlspecialchars($webConfig['texts']['pricing_subtitle']); ?>
                </p>
            </div>
            
            <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
                <?php foreach ($webConfig['pricing'] as $package): ?>
                    <div class="<?php echo $cardClass; ?> relative <?php echo $package['recommended'] ? 'border-2 border-blue-500 scale-105 z-10' : ''; ?>">
                        <?php if ($package['recommended']): ?>
                            <div class="absolute top-0 right-0 bg-blue-500 text-white text-xs font-bold px-3 py-1 rounded-bl-lg">
                                推荐
                            </div>
                        <?php endif; ?>
                        
                        <h3 class="text-2xl font-bold text-gray-900 mb-1"><?php echo htmlspecialchars($package['title']); ?></h3>
                        <p class="text-gray-600 mb-6"><?php echo htmlspecialchars($package['subtitle']); ?></p>
                        
                        <div class="mb-6">
                            <span class="text-4xl font-bold text-gray-900">¥<?php echo number_format($package['price']); ?></span>
                            <span class="text-gray-600 ml-1"><?php echo htmlspecialchars($package['period']); ?></span>
                        </div>
                        
                        <ul class="space-y-3 mb-8">
                            <?php foreach ($package['features'] as $feature): ?>
                                <li class="flex items-start">
                                    <i class="fa <?php echo $webConfig['classes']['feature_icon']; ?> text-green-500 mt-1"></i>
                                    <span class="text-gray-700"><?php echo htmlspecialchars($feature); ?></span>
                                </li>
                            <?php endforeach; ?>
                        </ul>
                        
                        <a href="#web-form" class="<?php echo $webConfig['classes']['button_secondary']; ?>">
                            选择此方案
                        </a>
                    </div>
                <?php endforeach; ?>
            </div>
            
            <div class="text-center mt-10">
                <p class="text-gray-600">
                    <?php echo htmlspecialchars($webConfig['texts']['custom_solution_text']); ?>
                    <a href="#web-form" class="text-blue-600 hover:underline font-medium">
                        <?php echo htmlspecialchars($webConfig['texts']['contact_us_text']); ?>
                    </a>
                    <?php echo htmlspecialchars($webConfig['texts']['get_custom_quote']); ?>
                </p>
            </div>
        </div>
        
        <!-- 开发咨询表单 -->
        <div id="web-form" class="max-w-4xl mx-auto bg-gray-50 rounded-2xl overflow-hidden">
            <div class="grid grid-cols-1 lg:grid-cols-2">
                <!-- 表单信息 -->
                <div class="p-8 lg:p-12 bg-gradient-to-br from-blue-600 to-indigo-700 text-white">
                    <h2 class="text-3xl font-bold mb-4">
                        <?php echo htmlspecialchars($webConfig['cta']['title']); ?>
                    </h2>
                    <p class="mb-8 opacity-90">
                        <?php echo htmlspecialchars($webConfig['cta']['subtitle']); ?>
                    </p>
                    
                    <div class="space-y-6">
                        <?php foreach ($webConfig['cta']['features'] as $feature): ?>
                            <div class="flex items-start">
                                <div class="flex-shrink-0 w-10 h-10 rounded-full bg-white/20 flex items-center justify-center">
                                    <i class="fa <?php echo htmlspecialchars($feature['icon']); ?>"></i>
                                </div>
                                <div class="ml-4">
                                    <h4 class="font-semibold mb-1"><?php echo htmlspecialchars($feature['title']); ?></h4>
                                    <p class="text-sm opacity-80"><?php echo htmlspecialchars($feature['description']); ?></p>
                                </div>
                            </div>
                        <?php endforeach; ?>
                    </div>
                </div>
                
                <!-- 表单 -->
                <div class="p-8 lg:p-12 bg-white">
                    <!-- 表单状态反馈 -->
                    <div id="<?php echo $webConfig['form']['id']; ?>-success" class="hidden mb-6 p-4 bg-green-50 border border-green-200 rounded-lg text-green-800">
                        <div class="flex">
                            <i class="fa fa-check-circle text-green-500 mt-0.5 mr-3"></i>
                            <span><?php echo htmlspecialchars($webConfig['texts']['form_success_message']); ?></span>
                        </div>
                    </div>
                    
                    <form 
                        action="<?php echo htmlspecialchars($webConfig['cta']['form_action']); ?>" 
                        method="post"
                        class="space-y-6"
                        id="<?php echo $webConfig['form']['id']; ?>"
                        novalidate
                    >
                        <?php foreach ($webConfig['form']['fields'] as $field): ?>
                            <div>
                                <label for="<?php echo htmlspecialchars($field['name']); ?>" class="<?php echo $webConfig['classes']['form_label']; ?>">
                                    <?php echo htmlspecialchars($field['label']); ?>
                                    <?php if ($field['required']): ?>
                                        <span class="<?php echo $webConfig['classes']['required_indicator']; ?>">
                                            <?php echo htmlspecialchars($webConfig['texts']['required_mark']); ?>
                                        </span>
                                    <?php endif; ?>
                                </label>
                                
                                <?php if ($field['type'] === 'textarea'): ?>
                                    <textarea 
                                        id="<?php echo htmlspecialchars($field['name']); ?>" 
                                        name="<?php echo htmlspecialchars($field['name']); ?>" 
                                        rows="<?php echo $field['rows'] ?? 4; ?>"
                                        placeholder="<?php echo htmlspecialchars($field['placeholder'] ?? ''); ?>"
                                        <?php echo $field['required'] ? 'required' : ''; ?>
                                        class="<?php echo $webConfig['classes']['form_field']; ?>"
                                    ></textarea>
                                <?php elseif ($field['type'] === 'select'): ?>
                                    <select 
                                        id="<?php echo htmlspecialchars($field['name']); ?>" 
                                        name="<?php echo htmlspecialchars($field['name']); ?>" 
                                        <?php echo $field['required'] ? 'required' : ''; ?>
                                        class="<?php echo $webConfig['classes']['form_field']; ?>"
                                    >
                                        <?php foreach ($field['options'] as $value => $label): ?>
                                            <option value="<?php echo htmlspecialchars($value); ?>">
                                                <?php echo htmlspecialchars($label); ?>
                                            </option>
                                        <?php endforeach; ?>
                                    </select>
                                <?php else: ?>
                                    <input 
                                        type="<?php echo htmlspecialchars($field['type']); ?>" 
                                        id="<?php echo htmlspecialchars($field['name']); ?>" 
                                        name="<?php echo htmlspecialchars($field['name']); ?>" 
                                        placeholder="<?php echo htmlspecialchars($field['placeholder'] ?? ''); ?>"
                                        <?php echo $field['required'] ? 'required' : ''; ?>
                                        class="<?php echo $webConfig['classes']['form_field']; ?>"
                                    >
                                <?php endif; ?>
                            </div>
                        <?php endforeach; ?>
                        
                        <div class="pt-2">
                            <button 
                                type="submit" 
                                class="w-full py-3 px-4 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-all duration-300 shadow hover:shadow-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"
                            >
                                <span id="<?php echo $webConfig['form']['id']; ?>-submit-text">
                                    <?php echo htmlspecialchars($webConfig['cta']['button_text']); ?>
                                </span>
                                <i class="fa fa-paper-plane ml-2"></i>
                                <div id="<?php echo $webConfig['form']['id']; ?>-loading" class="ml-2 hidden">
                                    <i class="fa fa-spinner fa-spin"></i>
                                </div>
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- 网页开发服务交互脚本 -->
<script>
document.addEventListener('DOMContentLoaded', function() {
    // 配置参数
    const formConfig = {
        formId: <?php echo json_encode($webConfig['form']['id']); ?>,
        successMessage: <?php echo json_encode($webConfig['texts']['form_success_message']); ?>,
        submittingText: <?php echo json_encode($webConfig['texts']['form_submitting_text']); ?>,
        submitText: <?php echo json_encode($webConfig['cta']['button_text']); ?>
    };
    
    // 服务卡片动画
    const serviceCards = document.querySelectorAll('[data-service-card]');
    const observer = new IntersectionObserver((entries) => {
        entries.forEach(entry => {
            if (entry.isIntersecting) {
                entry.target.style.opacity = '1';
                entry.target.style.transform = 'translateY(0)';
                observer.unobserve(entry.target);
            }
        });
    }, { threshold: 0.1 });
    
    serviceCards.forEach((card, index) => {
        card.style.opacity = '0';
        card.style.transform = 'translateY(30px)';
        card.style.transition = `opacity 0.5s ease ${index * 0.1}s, transform 0.5s ease ${index * 0.1}s`;
        observer.observe(card);
    });
    
    // 流程步骤动画
    const processSteps = document.querySelectorAll('.<?php echo $webConfig['classes']['process_step_wrapper']; ?>');
    const processObserver = new IntersectionObserver((entries) => {
        entries.forEach(entry => {
            if (entry.isIntersecting) {
                entry.target.style.opacity = '1';
                entry.target.style.transform = 'translateY(0)';
                processObserver.unobserve(entry.target);
            }
        });
    }, { threshold: 0.2 });
    
    processSteps.forEach((step, index) => {
        step.style.opacity = '0';
        step.style.transform = 'translateY(20px)';
        step.style.transition = `opacity 0.5s ease ${index * 0.15}s, transform 0.5s ease ${index * 0.15}s`;
        processObserver.observe(step);
    });
    
    // 表单提交处理
    const webForm = document.getElementById(formConfig.formId);
    if (webForm) {
        webForm.addEventListener('submit', function(e) {
            e.preventDefault();
            
            // 获取表单元素
            const submitButton = this.querySelector('button[type="submit"]');
            const submitText = document.getElementById(`${formConfig.formId}-submit-text`);
            const loadingIndicator = document.getElementById(`${formConfig.formId}-loading`);
            const successMessage = document.getElementById(`${formConfig.formId}-success`);
            
            // 显示加载状态
            submitButton.disabled = true;
            if (submitText) submitText.textContent = formConfig.submittingText;
            if (loadingIndicator) loadingIndicator.classList.remove('hidden');
            if (successMessage) successMessage.classList.add('hidden');
            
            // 模拟表单提交
            setTimeout(() => {
                // 显示成功消息
                if (successMessage) {
                    successMessage.classList.remove('hidden');
                    successMessage.scrollIntoView({ behavior: 'smooth', block: 'start' });
                }
                
                // 重置表单和按钮
                this.reset();
                submitButton.disabled = false;
                if (submitText) submitText.textContent = formConfig.submitText;
                if (loadingIndicator) loadingIndicator.classList.add('hidden');
            }, 1500);
        });
    }
    
    // 平滑滚动
    document.querySelectorAll('a[href^="#"]').forEach(anchor => {
        anchor.addEventListener('click', function(e) {
            e.preventDefault();
            
            const targetId = this.getAttribute('href');
            const targetElement = document.querySelector(targetId);
            
            if (targetElement) {
                targetElement.scrollIntoView({
                    behavior: 'smooth',
                    block: 'start'
                });
            }
        });
    });
});
</script>
